package com.oneplus.repositorys;



import com.oneplus.entitys.AddressAndPubKey;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import java.util.Set;


public interface AddressAndPubkeyRepository extends CrudRepository<AddressAndPubKey, Long> {

    @Query(value = "select addressAndPubKey.pubKey from AddressAndPubKey addressAndPubKey where addressAndPubKey.pubKey in(:#{#pubkeys})")
    Set<String> findByPubkeys(@Param("pubkeys") Set pubkeys);

    @Query(value = "select addressAndPubKey from AddressAndPubKey addressAndPubKey where addressAndPubKey.address =:#{#address}")
    AddressAndPubKey findByAddress(@Param("address") String address);
}
